<?php
    class Page extends MY_Controller {
    
        function _init() {
            $this->resource = 'page';
            $this->load->model('page_model', 'pages'); 
        }
        
        function index() {
            $page = $this->pages->getDefaultPage(1);
            $this->load->vars($page);
            $this->layout->load('page');            
        }
        
        function view($id = 1) {
            $page = $this->pages->getPage($id);
            if($page == FALSE) {
                show_404();
            }
            $this->load->vars($page);                        
            $this->layout->load('page');            
        }
    }
?>